package it.pecuswap.client.rest.service;

import javax.ws.rs.NotFoundException;

import it.pecuswap.client.rest.ClientProvider;
import it.pecuswap.commons.client.rest.interfaces.BackendMonitorServiceInterface;
import it.pecuswap.commons.exceptions.PecuswapRestException;
import it.pecuswap.exceptions.ConfigurationException;

public class BackendMonitorServiceClient extends ClientProvider implements
		BackendMonitorServiceInterface {
	
	private BackendMonitorServiceInterface backendMonitorServiceInterface = null;

	public BackendMonitorServiceClient() throws ConfigurationException{
		backendMonitorServiceInterface = super.serviceClientInterfaceProvider(BackendMonitorServiceInterface.class);
	}

	@Override
	public boolean pingBackend() throws PecuswapRestException {
		try{
			return backendMonitorServiceInterface.pingBackend();
		} catch (NotFoundException e){
			return false;
		}
	}

	

	
}
